]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
theme: make a GResource
authorCosimo Cecchi <cosimoc@gnome.org>
Fri, 19 Sep 2014 02:24:46 +0000 (19:24 -0700)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 15 Oct 2014 01:54:18 +0000 (18:54 -0700)
Now that we have all the infrastructure ready, port the theme to a
GResource.

https://bugzilla.gnome.org/show_bug.cgi?id=736936

.gitignore
data/Makefile.am
data/gnome-shell-theme.gresource.xml [new file with mode: 0644]
js/gdm/authPrompt.js
js/ui/background.js
js/ui/main.js
js/ui/modalDialog.js
js/ui/status/network.js

index e0147ae05f2945fa7460ea6f43b017f72519cdf7..bd6eb74605fbfebf2b197455bd1f9ef2905a84c7 100644 (file)
@@ -23,6 +23,7 @@ data/gnome-shell-wayland.desktop
 data/gnome-shell-wayland.desktop.in
 data/gnome-shell-extension-prefs.desktop
 data/gnome-shell-extension-prefs.desktop.in
+data/gnome-shell-theme.gresource
 data/gschemas.compiled
 data/perf-background.xml
 data/org.gnome.shell.gschema.xml
index 65f948aea74ac8832f85bcef0f4dc382aef3d1b5..de27d8eff551777850f02dad494dc55f4f3a63ec 100644 (file)
@@ -35,44 +35,11 @@ introspection_DATA =                                \
        org.gnome.ShellSearchProvider.xml       \
        org.gnome.ShellSearchProvider2.xml
 
-themedir = $(pkgdatadir)/theme
-dist_theme_DATA =                              \
-       theme/calendar-arrow-left.svg           \
-       theme/calendar-arrow-right.svg          \
-       theme/calendar-today.svg                \
-       theme/checkbox-focused.svg              \
-       theme/checkbox-off-focused.svg          \
-       theme/checkbox-off.svg                  \
-       theme/checkbox.svg                      \
-       theme/close-window.svg                  \
-       theme/close.svg                         \
-       theme/corner-ripple-ltr.png             \
-       theme/corner-ripple-rtl.png             \
-       theme/dash-placeholder.svg              \
-       theme/filter-selected-ltr.svg           \
-       theme/filter-selected-rtl.svg           \
-       theme/gnome-shell.css                   \
-       theme/logged-in-indicator.svg           \
-       theme/message-tray-background.png       \
-       theme/more-results.svg                  \
-       theme/noise-texture.png                 \
-       theme/page-indicator-active.svg         \
-       theme/page-indicator-inactive.svg       \
-       theme/page-indicator-checked.svg        \
-       theme/page-indicator-hover.svg          \
-       theme/panel-button-border.svg           \
-       theme/panel-button-highlight-narrow.svg \
-       theme/panel-button-highlight-wide.svg   \
-       theme/process-working.svg               \
-       theme/running-indicator.svg             \
-       theme/source-button-border.svg          \
-       theme/summary-counter.svg               \
-       theme/toggle-off-us.svg                 \
-       theme/toggle-off-intl.svg               \
-       theme/toggle-on-us.svg                  \
-       theme/toggle-on-intl.svg                \
-       theme/ws-switch-arrow-up.png            \
-       theme/ws-switch-arrow-down.png
+resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir)/theme --generate-dependencies $(srcdir)/gnome-shell-theme.gresource.xml)
+gnome-shell-theme.gresource: gnome-shell-theme.gresource.xml $(resource_files)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/theme $<
+resourcedir = $(pkgdatadir)
+resource_DATA = gnome-shell-theme.gresource
 
 backgrounddir = $(pkgdatadir)
 background_DATA = perf-background.xml
@@ -116,7 +83,9 @@ EXTRA_DIST =                                         \
        perf-background.xml.in                          \
        org.gnome.Shell.PortalHelper.desktop.in         \
        org.gnome.Shell.PortalHelper.service.in         \
-       org.gnome.shell.gschema.xml.in.in
+       org.gnome.shell.gschema.xml.in.in               \
+       gnome-shell-theme.gresource.xml                 \
+       $(resource_files)
 
 CLEANFILES +=                                          \
        gnome-shell.desktop.in                          \
@@ -128,4 +97,5 @@ CLEANFILES +=                                                \
        perf-background.xml                             \
        gschemas.compiled                               \
        org.gnome.shell.gschema.valid                   \
-       org.gnome.shell.gschema.xml.in
+       org.gnome.shell.gschema.xml.in                  \
+       gnome-shell-theme.gresource
diff --git a/data/gnome-shell-theme.gresource.xml b/data/gnome-shell-theme.gresource.xml
new file mode 100644 (file)
index 0000000..d473494
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/shell/theme">
+    <file>calendar-arrow-left.svg</file>
+    <file>calendar-arrow-right.svg</file>
+    <file>calendar-today.svg</file>
+    <file>checkbox-focused.svg</file>
+    <file>checkbox-off-focused.svg</file>
+    <file>checkbox-off.svg</file>
+    <file>checkbox.svg</file>
+    <file>close-window.svg</file>
+    <file>close.svg</file>
+    <file>corner-ripple-ltr.png</file>
+    <file>corner-ripple-rtl.png</file>
+    <file>dash-placeholder.svg</file>
+    <file>filter-selected-ltr.svg</file>
+    <file>filter-selected-rtl.svg</file>
+    <file>gnome-shell.css</file>
+    <file>logged-in-indicator.svg</file>
+    <file>message-tray-background.png</file>
+    <file>more-results.svg</file>
+    <file>noise-texture.png</file>
+    <file>page-indicator-active.svg</file>
+    <file>page-indicator-inactive.svg</file>
+    <file>page-indicator-checked.svg</file>
+    <file>page-indicator-hover.svg</file>
+    <file>panel-button-border.svg</file>
+    <file>panel-button-highlight-narrow.svg</file>
+    <file>panel-button-highlight-wide.svg</file>
+    <file>process-working.svg</file>
+    <file>running-indicator.svg</file>
+    <file>source-button-border.svg</file>
+    <file>summary-counter.svg</file>
+    <file>toggle-off-us.svg</file>
+    <file>toggle-off-intl.svg</file>
+    <file>toggle-on-us.svg</file>
+    <file>toggle-on-intl.svg</file>
+    <file>ws-switch-arrow-up.png</file>
+    <file>ws-switch-arrow-down.png</file>
+  </gresource>
+</gresources>
index 529e8c555ccdc9c18ea31d934d59f83deb837f61..1e51faa5cc686e00cd196af250d3b66a09dc4371 100644 (file)
@@ -127,7 +127,7 @@ const AuthPrompt = new Lang.Class({
 
         this._initButtons();
 
-        let spinnerIcon = Gio.File.new_for_path(global.datadir + '/theme/process-working.svg');
+        let spinnerIcon = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/process-working.svg');
         this._spinner = new Animation.AnimatedIcon(spinnerIcon, DEFAULT_BUTTON_WELL_ICON_SIZE);
         this._spinner.actor.opacity = 0;
         this._spinner.actor.show();
index 14b344414f74e0bd003b416a762c57abca418c82..7de204b60a0ab5f8bb7605bcfedbbd8eaf76b534 100644 (file)
@@ -459,7 +459,7 @@ const SystemBackground = new Lang.Class({
     Name: 'SystemBackground',
 
     _init: function() {
-        let file = Gio.File.new_for_path(global.datadir + '/theme/noise-texture.png');
+        let file = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/noise-texture.png');
 
         if (_systemBackground == null) {
             _systemBackground = new Meta.Background({ meta_screen: global.screen });
index 994bbe47808f8ab22dea326200bd8e564d2453d6..149e25a054ab79f8ed96e304c242a720f26102a0 100644 (file)
@@ -131,6 +131,9 @@ function _initializeUI() {
     Shell.WindowTracker.get_default();
     Shell.AppUsage.get_default();
 
+    let resource = Gio.Resource.load(global.datadir + '/gnome-shell-theme.gresource');
+    resource._register();
+
     _loadDefaultStylesheet();
 
     // Setup the stage hierarchy early
@@ -228,7 +231,7 @@ function _loadDefaultStylesheet() {
     if (!sessionMode.isPrimary)
         return;
 
-    let stylesheet = Gio.File.new_for_path(global.datadir + '/theme/' + sessionMode.stylesheetName);
+    let stylesheet = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/' + sessionMode.stylesheetName);
     if (_defaultCssStylesheet && _defaultCssStylesheet.equal(stylesheet))
         return;
 
index 102df19a1ff3c2d052614959dc51d4bb8a572029..d1d49710cbb66c14df078c5ad8fa769f674e2dcd 100644 (file)
@@ -194,7 +194,7 @@ const ModalDialog = new Lang.Class({
     },
 
     placeSpinner: function(layoutInfo) {
-        let spinnerIcon = Gio.File.new_for_path(global.datadir + '/theme/process-working.svg');
+        let spinnerIcon = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/process-working.svg');
         this._workSpinner = new Animation.AnimatedIcon(spinnerIcon, WORK_SPINNER_ICON_SIZE);
         this._workSpinner.actor.opacity = 0;
         this._workSpinner.actor.show();
index fb6662b3d4e058f68937310c53dc92d24b9b871c..728584c1ba728f930b8519f11325d5804858fd96 100644 (file)
@@ -876,7 +876,7 @@ const NMWirelessDialog = new Lang.Class({
                                                  x_align: Clutter.ActorAlign.CENTER,
                                                  y_align: Clutter.ActorAlign.CENTER });
 
-        let file = Gio.File.new_for_path(global.datadir + '/theme/process-working.svg');
+        let file = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/process-working.svg');
         this._noNetworksSpinner = new Animation.AnimatedIcon(file, 24, 24);
         this._noNetworksBox.add_actor(this._noNetworksSpinner.actor);
         this._noNetworksBox.add_actor(new St.Label({ style_class: 'no-networks-label',